<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        .box1 {
            width: 100px;
            height: 100px;

        }
        .bg-red {
            background-color: red;
        }
        .bg-blue {
            background-color: blue;
        }
    </style>
</head>
<body>
加上v-bind表示属性的来源于Vue，简写 是一个冒号 :
<div id="app">
    <button @click="changeBg">改变样式</button>
    <div :class="['box1', {sty: false}]"></div>
</div>
</body>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                sty: 'bg-red'
            }
        },
        methods: {
            changeBg() {

            }
        }
    })
</script>
</html>